﻿

using IotContract.Dtos.Clients;
using IotContract.Dtos.Servers.Pushs;
using IotContract.Models.Clients;
using IotContract.Models.Mqtt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IotContract.Interfaces;
public interface IServerDataManager
{
    /// <summary>
    /// 协议类型
    /// </summary>
    public string ProtobufType { get; set; }
    /// <summary>
    /// 接收推送过来的设备数据
    /// </summary>
    /// <param name="equipList"></param>
    /// <returns></returns>
    Task<List<OperationWriteCommand>> PushEquips(List<IPushEquip> equipList);

    /// <summary>
    /// 获取设备信息
    /// </summary>
    /// <param name="command"></param>
    /// <returns></returns>
    Task<List<IPushEquip>> GetEquips(ClientRequestCommand command);

    /// <summary>
    /// 清除设备数据
    /// </summary>
    /// <returns></returns>
    Task ClearEquips();

    /// <summary>
    /// 获取设备数据
    /// </summary>
    /// <param name="command"></param>
    /// <returns></returns>
    Task<List<IPushEquip>> GetEquips(List<ClientRequestCommand> commands);

    /// <summary>
    /// 添加写入命令
    /// </summary>
    /// <param name="command"></param>
    /// <returns></returns>
    Task<bool> AddWrite(OperationWriteCommand command);
    /// <summary>
    /// 添加写入命令
    /// </summary>
    /// <param name="command"></param>
    /// <returns></returns>
    /// <exception cref="NotImplementedException"></exception>
    Task<bool> AddWrites(IEnumerable<OperationWriteCommand> commands);

    /// <summary>
    /// 添加报警
    /// </summary>
    /// <param name="warns"></param>
    /// <returns></returns>
    Task<bool> AddWarns(IEnumerable<IotEquipWarnDto> warns);

}
